#ifndef _ColorMaterial_H_
#define _ColoMaterialr_H_

#pragma once
#include "Material.h"

class ColorMaterial : public Material {
private:
	Color color, colorStrength;
public:
	ColorMaterial() : color(Colors::Black) {};
	ColorMaterial(const Color &c, Float strength = 1) : color(c) {
		setStrength(strength);
	}
	ColorMaterial(Float g, Float strength = 1) : color(Color(g)) {
		setStrength(strength);
	}
	ColorMaterial(Byte g, Float strength = 1) : color(ColorByte(g, g, g)) {
		setStrength(strength);
	}
	ColorMaterial(Float r, Float g, Float b, Float strength = 1) : color(Color(r, g, b)) {
		setStrength(strength);
	}
	ColorMaterial(Byte r, Byte g, Byte b, Float strength = 1) : color(ColorByte(r, g, b)) {
		setStrength(strength);
	}
	~ColorMaterial() {};

	Color shade(const Scene *scene, const Ray &ray, const IntersectResult &intersect, const TraceState & traceState) const {
		return colorStrength;
	}

	void setStrength(Float strength) override {
		this->strength = strength;
		colorStrength = color * strength;
	}

	Color getTransparentColor(const Scene * scene, const Ray & ray, const IntersectResult &intersect) const {
		return colorStrength;
	}
};

#endif // _ColorMaterial_H_